
<!DOCTYPE html>
<html style="height:auto;">
<head>
    <link rel="shortcut icon" href="favicon.ico" type="image/x-icon"/>  
	<meta charset="UTF-8">
	<title>WEB组件测试</title>
	<script type="text/javascript" src="./js/WebDataWindow.js" defer="defer"></script>
	<script type="text/javascript">
		function test1()
		{
			var dw_1=document.getElementById('dw_1');
			console.log(dw_1.div_data.onscroll);
			//dw_1.setSort('prodarea,goodstype desc');
			//dw_1.sort();
			//alert('排序耗时'+(d_end.getTime() - d_start.getTime())+'.');
			//dw_1.retrieve();
		}
		function coldraw(td,colVal)
		{
			//console.log('call custom coldraw success.');
			td.innerHTML="<A href='javascript:void(0)'>"+colVal+"</a>";
		}
		function show()
		{
			var dw_1=document.getElementById('dw_1');
			dw_1.showWaiting();
		}
		function hide()
		{
			var dw_1=document.getElementById('dw_1');
			dw_1.hideWaiting();
		}
		function filtertest1()
		{
			var dw_1=document.getElementById('dw_1');
			dw_1.setFilter('col(prodarea) == "白云山总厂"');
			dw_1.filter();
			alert('rowcount='+dw_1.getRowCount());
		}
		function filtertest2()
		{
			var dw_1=document.getElementById('dw_1');
			dw_1.setFilter('col(prodarea) == "哈药六厂"');
			dw_1.filter();
			alert('rowcount='+dw_1.getRowCount());
		}
		function filtertest3()
		{
			var dw_1=document.getElementById('dw_1');
			dw_1.setFilter('');
			dw_1.filter();
			alert('rowcount='+dw_1.getRowCount());
		}
	</script>
</head>
<body style="height:auto;">
	<input type='button' value='点我' onclick="test1();"/>
	<input type='button' value='显示' onclick="show()"/>
	<input type='button' value='隐藏' onclick="hide()"/>
	<input type='button' value='过滤白云山总厂' onclick="filtertest1()"/>
	<input type='button' value='过滤哈药六厂' onclick="filtertest2()"/>
	<input type='button' value='重置过滤' onclick="filtertest3()"/>
	<div>
		<web-dw id="dw_1" name="dw_1" width="600px" height="600px" serviceurl="./webcomponenttest?sql=555" bordercolor="#888" borderstyle="inset" borderwidth="2px">
			<web-dwcomfield id="sumgoodsid" name="sumgoodsid" computeexp="col(goodsid)" valuekey="sumgoodsid" area="footer" colposition="1" coldatatype="1"></web-dwcomfield>
			<web-dwcol id="rownum" name="rownum" width="50px" coltitle="行号" coltype="2" coldatatype="1" computeexp="getrow()"></web-dwcol>
			<web-dwcol id="goodsid" name="goodsid" width="300px" coltitle="货品ID" coldatatype="1" ></web-dwcol>
			<web-dwcol id="goodsname" name="goodsname" width="300px" coltitle="品名" coldatatype="2" ondraw="coldraw(td,colVal)"></web-dwcol>
			<web-dwcol id="opcode" name="opcode" width="200px" coltitle="操作码" coldatatype="2"></web-dwcol>
			<web-dwcol id="goodstype" name="goodstype" width="200px" coltitle="规格" coldatatype="2"></web-dwcol>
			<web-dwcol id="goodsunit" name="goodsunit" width="50px" coltitle="单位" coldatatype="2"></web-dwcol>
			<web-dwcol id="prodarea" name="prodarea" width="150px" coltitle="产地" coldatatype="2"></web-dwcol>
			<web-dwcol id="computercol1" name="computercol1" width="150px" coltitle="计算列" coltype="2" coldatatype="2" computeexp="col(goodsid)+col(goodsname)"></web-dwcol>
		</web-dw>
	</div>
</body>
</html>